<?php

require_once 'swift_required.php';

//Create the Transport
/*
$transport = Swift_SmtpTransport::newInstance('mail.xtudio.com', 587);
$transport->setUsername('admin@xtudio.net');
$transport->setpassword('949361859');
*/

$transport = Swift_SmtpTransport::newInstance();


//Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);

//Create a message
$message = Swift_Message::newInstance('Wonderful Subject')
  ->setFrom(array('john@doe.com' => 'John Doe'))
  ->setTo(array('jorge@xtudio.com', 'jescgf@gmail.com' => 'A name'))
  ->setBody('Here is the message itself')
  ;
  
//Send the message
$numSent = $mailer->batchSend($message);

printf("Sent %d messages\n", $numSent);

if (!$mailer->send($message, $failures))
{
  echo "Failures:";
  print_r($failures);
}



/* Note that often that only the boolean equivalent of the
   return value is of concern (zero indicates FALSE)
   
if ($mailer->batchSend($message))
{
  echo "Sent\n";
}
else
{
  echo "Failed\n";
}

*/

?>